package com.niiwoo.civet.account.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhaoqiang
 * @ClassName: AccountPrizeTypeIdEnum
 * @Description: 红包类型枚举
 * @date 2017/11/23
 * var typs = {'0':'提现红包','1':'担保代金券','2':'担保投资代金券','3':'投资代金券','4':'现金红包','5':'担保理财金','7':'投资理财金','8':'投资加息券','9':'投资返现红包','10':'担保返现红包','11':'借款返现红包'};
 */
@Getter
@AllArgsConstructor
public enum AccountPrizeTypeIdEnum {

    // 红包类型：0 提现红包、 4现金红包、5担保理财金、7投资理财金、8投资加息券、 9投资返现红包、10担保返现红包、11借款返现红包 12借款利率折扣卡
    // 财富中心统计
//    投资奖励 105
//    7投资理财金、8投资加息券、 9投资返现红包、
//    平台奖励 104
//    0 提现红包、4现金红包、5担保理财金、10担保返现红包、11借款返现红包 12借款利率折扣卡
    WITHDRAW_VOUCHER((byte) 0, "提现红包", BillSecondSubjectEnum.PLATFORM_RED_OUT_WITHDRAW.getCode(), BillSecondSubjectEnum.USER_RED_WITHDRAW_COUPON.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    //GUARANTEE_VOUCHER((byte) 1, "担保代金券","",(byte),""),
    //GUARANTEE_INVESTMENT_VOUCHER((byte) 2, "担保投资代金券","",(byte),""),
    //INVESTMENT_VOUCHER((byte) 3, "投资代金券","",(byte),""),
    CASH_REDPACKET((byte) 4, "现金红包", BillSecondSubjectEnum.PLATFORM_RED_OUT_CASH.getCode(), BillSecondSubjectEnum.USER_RED_CASH.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    GUARANTEE_EXPERIENCE((byte) 5, "担保理财金", BillSecondSubjectEnum.PLATFORM_EXPERIENCE_BID_GUARANTEE_INCOME.getCode(), BillSecondSubjectEnum.USER_GUARANTEE_INCOME.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    //    GUARANTEE_INVESTMENT_EXPERIENCE((byte) 6, "担保投资体验券","",(byte),"",""),
    INVESTMENT_EXPERIENCE((byte) 7, "投资理财金", BillSecondSubjectEnum.PLATFORM_EXPERIENCE_BID_INVEST_INTEREST_PLATFORM.getCode(), BillSecondSubjectEnum.USER_RED_FINANCIAL_INTEREST.getCode(), AccountAmountTypeEnum.INVEST_GIVEN.getCode()),
    INVESTMENT_RAISE_INTEREST_RATES((byte) 8, "投资加息券", BillSecondSubjectEnum.PLATFORM_RED_OUT_INVEST_COUPON.getCode(), BillSecondSubjectEnum.USER_RED_COUPON_RATE_INTEREST.getCode(), AccountAmountTypeEnum.INVEST_GIVEN.getCode()),
    INVESTMENT_CASHBACK((byte) 9, "投资返现红包", BillSecondSubjectEnum.PLATFORM_RED_OUT_INVEST.getCode(), BillSecondSubjectEnum.USER_RED_INVEST.getCode(), AccountAmountTypeEnum.INVEST_GIVEN.getCode()),
    GUARANTEE_CASHBACK((byte) 10, "担保返现红包", BillSecondSubjectEnum.PLATFORM_RED_OUT_GUARANTEE_RETURN.getCode(), BillSecondSubjectEnum.USER_RED_GUARANTEE.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    LOAN_CASHBACK((byte) 11, "借款返现红包", BillSecondSubjectEnum.PLATFORM_RED_OUT_BORROW_RETURN.getCode(), BillSecondSubjectEnum.USER_RED_BORROW.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    BORROW_INTEREST_RATE_DISCOUNT((byte) 12, "借款利率折扣卡", BillSecondSubjectEnum.PLATFORM_SUBSIDIES_BORROW_INTEREST_RETURN.getCode(), BillSecondSubjectEnum.USER_SUBSIDY_BORROW.getCode(), AccountAmountTypeEnum.PLATFORM_GIVEN.getCode()),
    ACTIVITY_RAISE_INTEREST((byte) 13, "活动加息奖励", BillSecondSubjectEnum.PLATFORM_GIVEN_ACTIVITY_RAISE_INTEREST.getCode(), BillSecondSubjectEnum.USER_PLATFORM_GIVEN_ACTIVITY_RAISE_INTEREST.getCode(), AccountAmountTypeEnum.INVEST_GIVEN.getCode()),

    //神盾线下还款红包
    REISSUE_ORDER_AUDIT((byte) 20, "神盾-用户线下还款红包", BillSecondSubjectEnum.PLATFORM_RED_LINE_REPAYMENT.getCode(), BillSecondSubjectEnum.USER_RED_LINE_REPAYMENT.getCode(), 0),

    // 首次开户成功后，返还老账户余额 - 不加入财富中心计算
    RETURN_OLD_ACCOUNT_BALANCE((byte) 21, "首次开户成功后，返还老账户余额", BillSecondSubjectEnum.PLATFORM_RED_OUT_OPEN_ACCOUNT_RETURN.getCode(), BillSecondSubjectEnum.USER_RED_OPEN_ACCOUNT.getCode(), 0);

    private Byte prizeType;
    private String description;
    private String plateformBillCode;// 平台对应账单
    private String userBillCode; // 用户对应账单
    private Integer amountType; // 账户金额类型


    public static AccountPrizeTypeIdEnum getPrizeTypeId(Byte prizeTypeId) {
        for (AccountPrizeTypeIdEnum typeId : values()) {
            if (typeId.getPrizeType().equals(prizeTypeId)) {
                return typeId;
            }
        }
        return null;
    }
}
